package com.psnoted.backend.exception;

/**
 * 业务异常类
 * 用于处理业务逻辑相关的异常
 * 
 * @author PSNoted Team
 * @version 1.0.0
 */
public class BusinessException extends RuntimeException {

    private final int errorCode;

    public BusinessException(String message) {
        super(message);
        this.errorCode = 400;
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
        this.errorCode = 400;
    }

    public BusinessException(int errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public BusinessException(int errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
    }

    public int getErrorCode() {
        return errorCode;
    }
} 